package com.weichen.studentgameexchange.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 功能：
 * 作者：惟尘
 * 日期：2025/1/25 20:32
 */
@Getter
public enum AuditStatus {
    UNAUDITED(0, "待处理"),
    APPROVED(1, "已处理"),
    REMOVEDCOMMENT(2, "删除评论"),
    IGNOREREPORT(3, "忽略举报");
    @EnumValue
    private final int value;
    @JsonValue
    private final String desc;

    AuditStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static List<Integer> stringToValue(String str){
        List<Integer> list = new ArrayList<>();
        for (AuditStatus auditStatus : AuditStatus.values()){
            if (auditStatus.getDesc().contains(str))
                list.add(auditStatus.getValue());
        }
        return list;
    }
}
